-- Tags: no-fasttest

{% for storage in ["MergeTree", "ReplicatedMergeTree('/clickhouse/tables/{database}/test_01825_add_column/', 'r1')"] -%}

DROP TABLE IF EXISTS t_json_add_column;
SET enable_json_type = 1;

CREATE TABLE t_json_add_column (id UInt64) ENGINE = {{ storage }} ORDER BY tuple();

INSERT INTO t_json_add_column VALUES (1);
ALTER TABLE t_json_add_column ADD COLUMN s JSON;

INSERT INTO t_json_add_column VALUES(2, '{"k1": 100}');

SELECT * FROM t_json_add_column ORDER BY id FORMAT JSONEachRow;

ALTER TABLE t_json_add_column DROP COLUMN s;

SELECT * FROM t_json_add_column ORDER BY id FORMAT JSONEachRow;

DROP TABLE t_json_add_column;

{% endfor -%}
